﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;

namespace DAO
{
    public class HocKyDAO
    {
        public List<HocKyDTO> getHocKy()
        {
            List<HocKyDTO> list = new List<HocKyDTO>();

            ProviderDataContext context = new ProviderDataContext();
            var obj = from hk in context.HocKies
                      select hk;

            foreach (var hk in obj)
            {
                HocKyDTO dto = new HocKyDTO();
                dto.MaHK = hk.MaHK;
                dto.TenHK = hk.TenHocKy;

                list.Add(dto);
            }
            return list;
        }
    }
}
